<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>
        {{msg}}
        </div>
        <br>
        <div v-for="i,ind in todos">{{i.text}}</div>
    </div>
</body>
</html>
<script src="vue.min.js"></script>
<script src="axios.min.js"></script>
<script>
    new Vue({
        el:"#app",
        data:{
            msg:'测试',
            todos:[],
        },
        mounted(){
            axios.get("https://api.apiopen.top/getJoke").then(    //axios 发挥的是一个promise对象 所以可以直接.then
                res=>{
                    console.log(res)
                    this.todos = res.data.result;
                    console.log('tag', todos)
                    }
            ).catch(error=>{
                console.log(error)
            })
        }
    })
</script>